﻿using EventBus.Abstractions;
using System;
using System.Collections.Generic;
using System.Text;

namespace EventBus
{
    /// <summary>
    /// Abstract event bus.
    /// </summary>
    public abstract class AbstractEventBus
        : IEventBus
    {
        protected readonly IEventHandlerExecutionContext _eventHandlerExecutionContext;
        public AbstractEventBus(IEventHandlerExecutionContext eventHandlerExecutionContext)
        {
            _eventHandlerExecutionContext = eventHandlerExecutionContext;
        }


        public abstract void Publish<TEvent>(TEvent @event) 
            where TEvent : IEvent;


        public abstract void Subscribe<TEvent, TEventHandler>()
            where TEvent : IEvent
            where TEventHandler : IEventHandler;
    }
}
